package com.atom.process.cnmuseum.bm.dao.process;


import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Repository;

import com.atom.common.dao.AvensCommonDao;
import com.atom.common.mb.entity.gl.WhsxDO;
import com.atom.common.remote.user.UserUtil;
import com.atom.process.cnmuseum.bm.entity.process.BmWhsxProcessDO;

@Repository
public class BmWhsxProcessDao extends AvensCommonDao<BmWhsxProcessDO> {
    public List<BmWhsxProcessDO> findByProcessInstanceId(String processId) {
        List<BmWhsxProcessDO> list = super.findByProperty("processId", processId);
        return list;
    }


    public void createPDO(UserUtil user, String processInstanceId, String title, WhsxDO whsx) {
        BmWhsxProcessDO pdo = new BmWhsxProcessDO();
        BeanUtils.copyProperties(whsx, pdo, "id");
        pdo.setProcessId(processInstanceId);
        super.save(pdo);
    }

}
